using System;
using System.Collections.Generic;
using System.Text;
using Wrath.Xml;
using Wrath.RuleForge.Interfaces;

namespace Wrath.RuleForge.Property
{
    public static class ElementPropertyWrapperProvider
    {
        public static IPropertyWrapper<Element> CreateInstance(Element element)
        {
            IPropertyWrapper<Element> propertyWrapper = null;

            if (element.Name.ToLower() == "includefile")
            {
                propertyWrapper = new IncludeFileWrapper(element);                
            }
            else if (element.Name.ToLower() == "font")
            {
                propertyWrapper = new FontWrapper(element);
            }
            else if (element.Name.ToLower() == "template")
            {
                propertyWrapper = new TemplateWrapper(element);
            }
            else if (element.Name.ToLower() == "framedef")
            {
                propertyWrapper = new FrameDefWrapper(element);
            }
            else if (element.Name.ToLower() == "icon")
            {
                propertyWrapper = new IconWrapper(element);
            }
            else if (element.Name.ToLower() == "portraitset")
            {
                propertyWrapper = new PortraitSetWrapper(element);
            }
            else if (element.Name.ToLower() == "die")
            {
                propertyWrapper = new DieWrapper(element);
            }
            else if (element.Name.ToLower() == "customdie")
            {
                propertyWrapper = new CustomDieWrapper(element);
            }
            else if (element.Name.ToLower() == "diebox")
            {
                propertyWrapper = new DieBoxWrapper(element);
            }
            else if (element.Name.ToLower() == "pollbox")
            {
                propertyWrapper = new PollBoxWrapper(element);
            }
            else
            {
                propertyWrapper = new ElementPropertyWrapper(element);
            }

            return propertyWrapper;
        }
    }
}
